/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 */

import { hvigorTrace } from './hvigor-trace.js';

export function TrackAPI(_target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {
  const originalMethod = descriptor.value;
  descriptor.value = function (...args: any[]) {
    hvigorTrace.insertUsedApi(propertyKey);
    return originalMethod.apply(this, args);
  };
  return descriptor;
}